﻿using System;
using System.Collections.Generic;
using System.Text;
using System.ServiceModel;
using ProyectoCompartido;
using System.ServiceModel.Channels;
using System.Runtime.Remoting;

namespace Servidor
{
    public class FactoryDeServidor
    {
        public ServiceHost ObtenerServidorWCF()
        {
            System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(1033);
            System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(1033);

            Uri miurl = new Uri("net.tcp://localhost/ServidorWCF");
            ServiceHost Servicio = new ServiceHost(typeof(ServidorWCF), miurl);
            return Servicio;
        }

        public void CrearServidorNetRemoting()
        {
            System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(1033);
            System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(1033);

            RemotingConfiguration.Configure(AppDomain.CurrentDomain.SetupInformation.ConfigurationFile, false);
        }

    }
}
